package anji.plus.system.mark.exception;


import anji.plus.system.mark.response.ResponseCode;

/**
 * <p>
 * 全局业务异常
 * </p>
 *
 * @author zag
 * @since 2023/7/14
 */
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = -530873130894489291L;

    private Integer code;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public BusinessException() {
    }

    public BusinessException(String message) {
        super(message);
        this.code = -1;
    }

    public BusinessException(ResponseCode status) {
        super(status.message());
        this.code = status.code();
    }

    public BusinessException(Integer code,String message) {
        super(message);
        this.code = code;
    }

}
